package com.improvess.rna.som.knn;



public class Relationship implements Comparable<Relationship>{
	
	private double distance;
	private Pattern pattern;
	
	public Relationship(double distance, Pattern pattern){
		this.distance = distance;
		this.pattern = pattern;
	}

	@Override
	public int compareTo(Relationship rel) {
		if(this.distance<rel.distance){
			return -1;
		} else if(rel.distance==this.distance){
			return 0;
		} else return 1;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public Pattern getPattern() {
		return pattern;
	}

	public void setPattern(Pattern pattern) {
		this.pattern = pattern;
	}

}
